home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_mirrorgod.cog < prev    next >
Text File  |  1999-11-15  |  14KB  |  443 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEO_MirrorGod.cog
  4. #
  5. # Controls the final descent of the mirror god.
  6. #
  7. # [SXC]
  8. #
  9. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     message     startup
  14.     message     activate
  15.     message     taken
  16.     message     crossed
  17.     
  18.     surface     endsurf
  19.     thing       fadeplate
  20.     thing       finishcam
  21.     thing       finalactor 
  22.     
  23.     cog         godoorcog
  24.     
  25.     template    jagtemplate=jagidolmove      local
  26.     template    fishtemplate=fshidolmove     local
  27.     template    birdtemplate=brdidolmove     local
  28.     
  29.     thing       jagpos
  30.     thing       fishpos
  31.     thing       birdpos
  32.     
  33.     thing       jagnewidol      local
  34.     thing       fishnewidol     local
  35.     thing       birdnewidol     local
  36.     
  37.     thing       jagkey          linkid=2
  38.     thing       fishkey         linkid=2
  39.     thing       birdkey         linkid=2
  40.     
  41.     thing       gear0
  42.     thing       gear1
  43.     thing       gear2
  44.     thing       gear3
  45.     
  46.     thing       jagstand        linkid=4
  47.     thing       fishstand       linkid=4
  48.     thing       birdstand       linkid=4
  49.     
  50.     thing       jagcam
  51.     thing       jagcam_tgt
  52.     thing       birdcam
  53.     thing       birdcam_tgt
  54.     thing       fishcam
  55.     thing       fishcam_tgt
  56.     thing       statuecampos
  57.     
  58.     thing       statue
  59.     thing       column
  60.     thing       column1
  61.     thing       column2
  62.     thing       gear
  63.  
  64.     thing       player          local
  65.  
  66.     flex        moveSpeed=0.5
  67.     flex        statSpeed=2
  68.     flex        waittime        
  69.     
  70.     sound       idolplacesound=fol_in_landearth.wav local
  71.     sound       indyline0=to06j05.wav               local
  72.     
  73.     sound       indylinea0=To05j01.wav   local
  74.     sound       indylinea1=Bb11j02.wav   local
  75.     
  76.     sound       indylineb0=Inxj089.wav      local
  77.     sound       indylineb1=Inxj090.wav      local
  78.     sound       indylineb2=Inxj092.wav      local
  79.     sound       indylineb3=Inxj060.wav      local
  80.     sound       indylineb4=Inxj087.wav      local
  81.     sound       indylineb5=Inxj088.wav      local
  82.     
  83.     sound       indyaltar0=TO06J04.wav      local
  84.     sound       indyaltar1=TO06J05.wav      local
  85.     sound       indyaltar2=TO06J06.wav      local
  86.     sound       statsound=teo_spike_block_c.wav local
  87.     sound       finalwav=mus_gen_awechord2.wav    local
  88.     sound       doorstop=olv_quetzdoor_stop_c.wav   local
  89.  
  90.     int            idolcount                    local
  91.     int         mirrorcount                 local
  92.     int         actcheck=0                  local
  93.     int         birdidol=74                 local
  94.     int         fishidol=75                 local
  95.     int         jagidol=76                  local
  96.     int         eventcheck=0                local
  97.     int         wepnum=1                    local
  98.     int         lastrand=-1                 local
  99.     int         currand=0                   local
  100.     int            statchannel=0                local   
  101.     int         finalflag=0                 local
  102.     int         bin74=0                     local
  103.     int         bin75=0                     local
  104.     int         bin76=0                     local
  105.     
  106.     vector      playervec                   local
  107.     vector      playery                     local
  108.     vector      playerx                     local
  109.     vector      resetvec                    local
  110.     
  111.                       
  112.     
  113. end
  114.  
  115. # ========================================================================================
  116.  
  117. code
  118.  
  119. # ........................................................................................
  120. startup:
  121.  
  122.     player = GetLocalPlayerThing();
  123.     resetvec = VectorSet(0, 180, 0);
  124.     SetThingAlpha(fadeplate, 0);
  125.     
  126. return;
  127.  
  128. # ........................................................................................
  129. crossed:
  130.  
  131.     if ((GetSenderRef() == endsurf) && (finalflag == 0) && (GetSourceRef() == player))
  132.     {
  133.         finalflag=1;
  134.         StopThing(player);
  135.         SetActorFlags(player, 0x200000);
  136.         MakeMeStop(player);
  137.         DeselectWeaponWait(player);
  138.         SetThingFlags(player, 0x80000);
  139.         ClearThingFlags(finalactor, 0x80000);
  140.         AISetCutsceneMode(finalactor);
  141.         AISetMoveSpeed(finalactor, 1.1);
  142.         CopyPlayerHolsters(player, finalactor);
  143.         StartCutscene(1);
  144.         SetCameraFocus(2, finishcam);
  145.         SetCameraSecondaryFocus(2, finalactor);
  146.         SetCurrentCamera(2);
  147.         PlaySoundLocal(finalwav, 1, 0, 0, 0);
  148.         SetCameraFOV(100, 0, 0);
  149.         AISetMoveFrame(finalactor, 1);
  150.         AttachThingToThing(fadeplate, finishcam);
  151.         ThingFadeAnim(fadeplate, 0, 1, 2.5, 0);
  152.         Sleep(2.5);
  153.         JonesEndLevel();
  154.     }
  155.     
  156. return;
  157.  
  158. # ........................................................................................
  159.  
  160. activate:
  161.  
  162.     bin74=GetInv(player, 74);
  163.     bin75=GetInv(player, 75);
  164.     bin76=GetInv(player, 76);
  165.     
  166.     playervec = GetThingLVec(player);
  167.     playery = VectorY(playervec);
  168.     playerx = Vectorx(playervec);
  169.     
  170.     if ((GetCurItem(player) == 0) && 
  171.         (GetSenderID() == 4))        
  172.     {
  173.         StopThing(player);
  174.         StartCutscene(0);
  175.         SetActorFlags(player, 0x200000);
  176.         if ((bin74 + bin75 + bin76) == 1)
  177.         {
  178.             PlayVoice(player, indyaltar0, 1, 1);
  179.         }
  180.         
  181.         if ((bin74 + bin75 + bin76) == 2)
  182.         {
  183.             PlayVoice(player, indyaltar1, 1, 1);
  184.         }
  185.         
  186.         if ((bin74 + bin75 + bin76) == 0)
  187.         {
  188.             PlayVoice(player, indyaltar2, 1, 1);
  189.         }
  190.         EndCutscene();
  191.         ClearActorFlags(player, 0x200000);
  192.         return;
  193.     }
  194.     
  195.     //create the Jaguar idol    
  196.     if ((GetSenderRef() == jagstand) && 
  197.         (GetCurItem(player) == 76) && 
  198.         (actcheck == 0))
  199.     {
  200.         While(wepnum !=0)
  201.         {
  202.             wepnum = GetCurWeapon(player);
  203.             DeselectWeaponWait(player);
  204.             DeselectWeapon(player);
  205.         }
  206.         actcheck = 1;
  207.         SetCameraFocus(2, jagcam);
  208.         SetCameraSecondaryFocus(2, jagcam_tgt);
  209.         SetCurrentCamera(2);
  210.         SetCameraFOV(50, 0, 0);
  211.         StartCutscene(1);
  212.         SetActorFlags(player, 0x200000);
  213.         ChangeInv(player, 76, -1);
  214.         PlayMode(player, 61, 0);
  215.         sleep(0.35);
  216.         jagnewidol = CreateThing(jagtemplate, jagpos);
  217.         CaptureThing(jagnewidol);
  218.         AttachThingToThing(jagnewidol, jagstand);
  219.         PlaySoundThing(idolplacesound, jagnewidol, 1, 10, 20, 0x0080);
  220.         SetThingLight(jagnewidol, '0 1 0', 0.05, 0.5);
  221.         Sleep(1);
  222.         MoveToFrame(jagstand, 1, moveSpeed);
  223.         WaitForStop(jagstand);
  224.         sleep(1);
  225.         SetCameraFOV(90, 0 ,0);
  226.         SetCurrentCamera(1);
  227.         EndCutScene();
  228.         ClearActorFlags(player, 0x200000);
  229.         actcheck = 0;
  230.         wepnum = 1;
  231.         mirrorcount = mirrorcount + 1;
  232.     }
  233.     
  234.     //Create the Bird Idol
  235.     if ((GetSenderRef() == birdstand) && 
  236.         (GetCurItem(player) == 74) && 
  237.         (actcheck == 0))
  238.     {
  239.         While(wepnum !=0)
  240.         {
  241.             wepnum = GetCurWeapon(player);
  242.             DeselectWeaponWait(player);
  243.             DeselectWeapon(player);
  244.         }
  245.         //print("creating bird");
  246.         actcheck = 1;
  247.         SetCameraFocus(2, birdcam);
  248.         SetCameraSecondaryFocus(2, birdcam_tgt);
  249.         SetCurrentCamera(2);
  250.         SetCameraFOV(50, 0, 0);
  251.         StartCutscene(1);
  252.         SetActorFlags(player, 0x200000);
  253.         PlayMode(player, 61, 0);
  254.         sleep(0.35);
  255.         birdnewidol = CreateThing(birdtemplate, birdpos);
  256.         CaptureThing(birdnewidol);
  257.         AttachThingToThing(birdnewidol, birdstand);
  258.         PlaySoundThing(idolplacesound, birdnewidol, 1, 10, 20, 0x0080);
  259.         SetThingLight(birdnewidol, '1 1 0', 0.05, 0.5);
  260.         ChangeInv(player, 74, -1);
  261.         Sleep(1);
  262.         MoveToFrame(birdstand, 1, moveSpeed);
  263.         WaitForStop(birdstand);
  264.         sleep(1);
  265.         SetCurrentCamera(1);
  266.         SetCameraFOV(90, 0, 0);
  267.         EndCutScene();
  268.         ClearActorFlags(player, 0x200000);
  269.         actcheck = 0;
  270.         wepnum=1;
  271.         mirrorcount = mirrorcount + 1;
  272.     }
  273.     
  274.     //Create the Fish Idol
  275.     if ((GetSenderRef() == fishstand) && 
  276.         (GetCurItem(player) == 75) && 
  277.         (actcheck == 0))
  278.     {
  279.         While(wepnum !=0)
  280.         {
  281.             wepnum = GetCurWeapon(player);
  282.             DeselectWeaponWait(player);
  283.             DeselectWeapon(player);
  284.         }
  285.         actcheck = 1;
  286.         SetCameraFocus(2, fishcam);
  287.         SetCameraSecondaryFocus(2, fishcam_tgt);
  288.         SetCurrentCamera(2);
  289.         SetCameraFOV(50, 0, 0);
  290.         StartCutscene(1);
  291.         SetActorFlags(player, 0x200000);
  292.         PlayMode(player, 61, 0);
  293.         sleep(0.35);
  294.         fishnewidol = CreateThing(fishtemplate, fishpos);
  295.         CaptureThing(fishnewidol);
  296.         AttachThingToThing(fishnewidol, fishstand);
  297.         PlaySoundThing(idolplacesound, fishnewidol, 1, 10, 20, 0x0080);
  298.         SetThingLight(fishnewidol, '0 0 1', 0.05, 0.5);
  299.         ChangeInv(player, 75, -1);
  300.         Sleep(1);
  301.         MoveToFrame(fishstand, 1, moveSpeed);
  302.         WaitForStop(fishstand);
  303.         sleep(1);
  304.         SetCurrentCamera(1);
  305.         SetCameraFOV(90, 0, 0);
  306.         EndCutScene();
  307.         ClearActorFlags(player, 0x200000);
  308.         actcheck = 0;
  309.         wepnum=1;
  310.         mirrorcount = mirrorcount + 1;    
  311.     }
  312.     
  313.     //Send the statue down on the last item creation
  314.     if ((mirrorcount == 3) && (actcheck == 0))
  315.     {
  316.         actcheck = 1;
  317.         StartCutscene(1);
  318.         SetActorFlags(player, 0x200000);
  319.         SetCameraFocus(2, statuecampos);
  320.         SetCameraSecondaryFocus(2, statue);
  321.         SetCurrentCamera(2);
  322.         SetCollideType(gear0, 0);
  323.         SetCollideType(gear1, 0);
  324.         SetCollideType(gear2, 0);
  325.         SetCollideType(gear3, 0);
  326.         SetCollideType(statue, 0);
  327.         SetCollideType(column, 0);
  328.         SetCollideType(column1, 0);
  329.         SetCollideType(column2, 0);
  330.         SetCollideType(gear, 0);
  331.         Sleep(0.15);
  332.         statchannel=PlaySoundThing(statsound, statue, 1, 30, 50, 0x0081);
  333.         MoveToFrame(statue, 0, statSpeed);
  334.         MoveToFrame(column, 0, statSpeed);
  335.         MoveToFrame(column1, 0, statSpeed);
  336.         MoveToFrame(column2, 0, statSpeed);
  337.         MoveToFrame(gear, 0 , statSpeed);
  338.         WaitForStop(statue);
  339.         PlaySoundLocal(doorstop, 1, 0, 0, 0);
  340.         StopSound(statchannel, 0.0);
  341.         RotateToPYR(statue, resetvec, 1);
  342.         RotateToPYR(gear, resetvec, 1);
  343.         Sleep(1);
  344.         SetCollideType(statue, 3);
  345.         SetCollideType(column, 3);
  346.         SetCollideType(column1, 3);
  347.         SetCollideType(column2, 3);
  348.         SetCollideType(gear, 3);
  349.         SetCollideType(gear0, 3);
  350.         SetCollideType(gear1, 3);
  351.         SetCollideType(gear2, 3);
  352.         SetCollideType(gear3, 3);
  353.         SetCurrentCamera(1);
  354.         EndCutscene();
  355.         ClearActorFlags(player, 0x200000);
  356.         return;
  357.     }
  358.     
  359.     //Send message to big door cog        
  360.     if ((GetSenderRef() == statue) &&
  361.         (GetCurItem(player) == 63) &&
  362.         (mirrorcount == 3) && 
  363.         (GetCurFrame(statue) == 0) &&
  364.         (actcheck == 1) &&
  365.         (playery > 0) &&
  366.         (playerx < 0.984))
  367.     {
  368.         While(wepnum !=0)
  369.         {
  370.             wepnum = DeselectWeapon(player);
  371.             DeselectWeaponWait(player);
  372.         }
  373.         SendMessage(godoorcog, user0);
  374.         return;
  375.     }
  376.     else if ((GetSenderRef() == statue) &&
  377.              (GetCurItem(player) == 63) &&
  378.              (mirrorcount < 3))
  379.     {
  380.         StopThing(player);
  381.         SetActorFlags(player, 0x200000);
  382.         StartCutscene(1);
  383.         SetExtCamOffset('0.15 -0.05 0.04');
  384.         PlayVoice(player, indylinea1, 1, 1);
  385.         Sleep(1);
  386.         EndCutscene();
  387.         RestoreExtCam();
  388.         ClearActorFlags(player, 0x200000);
  389.         return;
  390.     }
  391.     else if ((GetSenderRef() == statue) && 
  392.              (GetCurItem(player) != 63))
  393.     {
  394.         StopThing(player);
  395.         SetActorFlags(player, 0x200000);
  396.         StartCutscene(1);
  397.         SetExtCamOffset('0.15 -0.05 0.04');
  398.         PlayVoice(player, indylinea0, 1, 1);
  399.         Sleep(1);
  400.         EndCutscene();
  401.         RestoreExtCam();
  402.         ClearActorFlags(player, 0x200000);
  403.         return;
  404.     }
  405.     
  406.     if ((GetCurItem(player) != 0) && (GetSenderID() == 4))
  407.     {
  408.         StopThing(player);
  409.         StartCutscene(0);
  410.         SetActorFlags(player, 0x200000);
  411.         currand = RandBetween(0, 5);
  412.         While (lastrand == currand)
  413.         {
  414.             currand = RandBetween(0, 5);
  415.         }
  416.         PlayVoice(player, indylineb0[currand], 1, 1);
  417.         lastrand = currand;
  418.         EndCutscene();
  419.         ClearActorFlags(player, 0x200000);
  420.         return;
  421.     }
  422.         
  423.     return;
  424.                             
  425. # ........................................................................................                
  426. taken:
  427.  
  428.     if (GetSenderID() == 2)
  429.     {
  430.         idolcount=idolcount + 1;
  431.     }
  432.     if (GetSenderID() == 3)
  433.     {
  434.         mirrorcount = 0;
  435.     }            
  436.     
  437. return;
  438.  
  439. # ........................................................................................
  440. end
  441.  
  442.  
  443.